/*
 * BedRacket - BedRacketMC
 * Copyright (C) 2018-2022.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
 */
package org.bedracket.event.item;

import net.minecraft.entity.ItemEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import org.bedracket.eventbus.Cancellable;

public class ItemTickEvent extends ItemEvent implements Cancellable {

    private boolean cancelled;

    private final World world;
    private final ItemStack stack;

    public ItemTickEvent(ItemEntity itemEntity, World world, ItemStack stack) {
        super(itemEntity);
        this.world = world;
        this.stack = stack;
    }

    @Override
    public boolean isCancelled() {
        return cancelled;
    }

    @Override
    public void setCancelled(boolean cancel) {
        this.cancelled = cancel;
    }

    public World getWorld() {
        return world;
    }

    public ItemStack getStack() {
        return stack;
    }
}
